<!DOCTYPE html>
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>首页</title>
	<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
	<link rel="stylesheet" href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
	<link rel="stylesheet" href="http://cdn.bootcss.com/animate.css/3.5.2/animate.min.css">
	<link rel="stylesheet" href="css/mq-simple.css">
	<script type="text/javascript">
		//时间
		function time()
		{
			var now= new Date();
			var year=now.getFullYear();
			var month=now.getMonth();
			var date=now.getDate();
			document.getElementById("timeshow").innerHTML=+year+"年"+(month+1)+"月"+date+"日";
		} 
	</script>
	</head>
	<body class="index_body animated fadeIn" onLoad="time()">
<div class="included clearfix">
      <?php
	    $query = " SELECT COUNT(*) AS dd FROM `#@__member` ";
	    $row1 = $dsql->GetOne($query);
	    $query = " SELECT COUNT(*) AS dd FROM `#@__feedback` ";
	    $row2 = $dsql->GetOne($query);
	    
	    $chArrNames = array();
	    $query = "SELECT id, typename FROM `#@__channeltype` ";
	    $dsql->Execute('c', $query);
	    while($row = $dsql->GetArray('c'))
	    {
	        $chArrNames[$row['id']] = $row['typename'];
	    }
	    
	    $query = "SELECT COUNT(channel) AS dd, channel FROM `#@__arctiny` GROUP BY channel ";
	    $allArc = 0;
	    $chArr = array();
	    $dsql->Execute('a', $query);
	    while($row = $dsql->GetArray('a'))
	    {
	        $allArc += $row['dd'];
	        $row['typename'] = $chArrNames[$row['channel']];
	        $chArr[] = $row;
	    }
	?>
      <div class="col-md-3 col-sm-6 col-xs-12">
    <div class="box wendang clearfix"> <a href="content_list.php">
      <div class="col-xs-4 icon"> <i class="fa fa-file-text-o fa-4x"></i> </div>
      <div class="col-xs-8 intro">
        <h3 class="total"><?php echo $allArc; ?></h3>
        <h5 class="name">文档数</h5>
      </div>
      </a> </div>
  </div>
      <div class="col-md-3 col-sm-6 col-xs-12">
    <div class="box bdsl clearfix"> <a href='https://www.baidu.com/s?ie=UTF-8&wd=site%3A<?php echo $_SERVER['SERVER_NAME'];?>' target="blank">
      <div class="col-xs-4 icon"> <i class="fa fa-bookmark-o fa-4x"></i> </div>
      <div class="col-xs-8 intro">
        <h3 class="total">
          <?php
							    $row = $dsql->GetOne("SELECT baidu_count FROM `#@__plus_seoinfo` ORDER BY id DESC LIMIT 0, 1");
							    echo $row['baidu_count'];
							?>
        </h3>
        <h5 class="name">百度收录</h5>
      </div>
      </a> </div>
  </div>
      <div class="col-md-3 col-sm-6 col-xs-12">
    <div class="box qhsl clearfix"> <a href='https://www.so.com/s?ie=utf-8&fr=none&src=sug-local&q=site%3A<?php echo $_SERVER['SERVER_NAME'];?>' target="blank">
      <div class="col-xs-4 icon"> <i class="fa fa-plus fa-4x"></i> </div>
      <div class="col-xs-8 intro">
        <h3 class="total">
          <?php
							    $row = $dsql->GetOne("SELECT haosou360_count FROM `#@__plus_seoinfo` ORDER BY id DESC LIMIT 0, 1");
							    echo $row['haosou360_count'];
							?>
        </h3>
        <h5 class="name">360收录</h5>
      </div>
      </a> </div>
  </div>
      <div class="col-md-3 col-sm-6 col-xs-12">
    <div class="box sgsl clearfix"> <a href='https://www.sogou.com/web?query=site%3A<?php echo $_SERVER['SERVER_NAME'];?>' target="blank">
      <div class="col-xs-4 icon"> <i class="fa fa-glass fa-4x"></i> </div>
      <div class="col-xs-8 intro">
        <h3 class="total">
          <?php
							    $row = $dsql->GetOne("SELECT sogou_count FROM `#@__plus_seoinfo` ORDER BY id DESC LIMIT 0, 1");
							    echo $row['sogou_count'];
							?>
        </h3>
        <h5 class="name">搜狗收录</h5>
      </div>
      </a> </div>
  </div>
    </div>
<div class="page1 rankview clearfix">
      <div class="col-sm-4 col-xs-12">
    <div class="mainbox user">
          <div class="maintitle"> 账户信息 </div>
          <div class="maincontent">
        <ul>
              <li>当前用户 : <?php echo $cuserLogin->getUserName(); ?></li>
              <li> 用户角色 :
            <?php
			           		if($cuserLogin->
						getUserType()==10) {
			                echo "总管理员";
			                    } else if($cuserLogin->getUserType()==5) {
			                         echo "频道总编";
			                    } else {
			                        echo "信息采集员或其它管理员";
			                    }
			            	?>
          </li>
              <li>今天是 : <span id="timeshow"></span></li>
            </ul>
      </div>
        </div>
  </div>
      <div class="col-sm-8 col-xs-12">
    <div class="mainbox quickmenu">
          <div class="maintitle"> 常用功能 </div>
          <div class="maincontent clearfix row">
        <div class="col-md-2 col-sm-4 col-xs-4">
              <div class="lmdh"> <a href="catalog_main.php"> <span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x"></i> <i class="fa fa-navicon fa-stack-1x fa-inverse"></i> </span>
                <p>栏目导航</p>
                </a> </div>
            </div>
        <div class="col-md-2 col-sm-4 col-xs-4">
              <div class="xtsz"> <a href="catalog_main.php"> <span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x"></i> <i class="fa fa-cog fa-stack-1x fa-inverse"></i> </span>
                <p>系统设置</p>
                </a> </div>
            </div>
        <div class="col-md-2 col-sm-4 col-xs-4">
              <div class="wzlb"> <a href="content_list.php"> <span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x"></i> <i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i> </span>
                <p>文章列表</p>
                </a> </div>
            </div>
        <div class="col-md-2 col-sm-4 col-xs-4">
              <div class="fbwz"> <a href="public_guide.php"> <span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x"></i> <i class="fa fa-paint-brush fa-stack-1x fa-inverse"></i> </span>
                <p>发表文章</p>
                </a> </div>
            </div>
        <div class="col-md-2 col-sm-4 col-xs-4">
              <div class="yqlj"> <a href="friendlink_main.php"> <span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x"></i> <i class="fa fa-retweet fa-stack-1x fa-inverse"></i> </span>
                <p>友情链接</p>
                </a> </div>
            </div>
        <div class="col-md-2 col-sm-4 col-xs-4">
              <div class="bdgl"> <a href="diy_main.php"> <span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x"></i> <i class="fa fa-file-excel-o fa-stack-1x fa-inverse"></i> </span>
                <p>表单管理</p>
                </a> </div>
            </div>
      </div>
        </div>
  </div>
    </div>
<div class="page2 rankview clearfix">
      <div class="col-md-4 col-sm-12">
    <div class="mainbox newarticle">
          <div class="maintitle"> 最新文档 </div>
          <div class="maincontent">
        <?php
                    $query = "SELECT arc.id, arc.arcrank, arc.title, arc.channel, ch.editcon  FROM `#@__archives` arc
                            LEFT JOIN `#@__channeltype` ch ON ch.id = arc.channel
                             WHERE arc.arcrank<>-2 ORDER BY arc.id DESC LIMIT 0, 13 ";
                    $arcArr = array();
                    $dsql->Execute('m', $query);
                    while($row = $dsql->GetArray('m'))
                    {
                        $arcArr[] = $row;
                    }
                ?>
        <table class="table table table-hover" id="totalList">
              <?php
                    if(count($arcArr) > 1)
                    {
                        foreach($arcArr as $row)
                        {
                            if(trim($row['editcon'])=='') {
                                $row['editcon'] = 'archives_edit.php';
                            }
                            $linkstr = "<tr><td><dd></dd></td><td><a href='{$row['editcon']}?aid={$row['id']}&channelid={$row['channel']}'>{$row['title']}</a></td></tr>";
                        ?>
              <tr> <?php echo $linkstr; ?> </tr>
              <?php
                        }
                    } else {
                    ?>
              <tr> 暂无新增内容 </tr>
              <?php
                    }
                    ?>
            </table>
      </div>
        </div>
  </div>
      <div class="col-md-4 col-sm-12">
    <div class="panel panel-default system">
          <div class="panel-heading"><i class="fa fa-bell fa-fw"></i> 系统信息 </div>
          <div class="panel-body">
        <div class="list-group"> <a class="list-group-item"> <i class="fa fa-flash fa-fw"></i> 是否安全模式 <span class="pull-right text-muted small"> <em><?php echo ($isSafeMode ? 'On' : 'Off')?></em> </span> </a> <a class="list-group-item"> <i class="fa fa-flask fa-fw"></i> Register_Globals <span class="pull-right text-muted small"> <em><?php echo ini_get("register_globals") ? 'On' : 'Off'?></em> </span> </a> <a class="list-group-item"> <i class="fa fa-magic fa-fw"></i> Magic_Quotes_Gpc <span class="pull-right text-muted small"> <em><?php echo ini_get("magic_quotes_gpc") ? 'On' : 'Off'?></em> </span> </a> <a class="list-group-item"> <i class="fa fa-cloud-upload fa-fw"></i> 支持上传的最大文件 <span class="pull-right text-muted small"> <em><?php echo ini_get("post_max_size")?></em> </span> </a> <a class="list-group-item"> <i class="fa fa-code fa-fw"></i> 其它必须函数检测 <span class="pull-right text-muted small"> <em>
          <?php
	                                $needfunc = array('dir','phpinfo');
	                                $n = 0;
	                                foreach($needfunc as $k) {
	                                    if(!function_exists($k)) {
	                                        echo "<font color='red'>[{$k}×]</font> ";
	                                        $n++;
	                                    }
	                                }
	                                if($n==0) {
	                                    echo "符合要求";
	                                } else {
	                                echo "被禁用的函数可能导致部份功能无法使用！";
	                                }
	                            ?>
          </em> </span> </a> <a class="list-group-item"> <i class="fa fa-check-square fa-fw"></i> 是否允许打开远程连接 <span class="pull-right text-muted small"> <em><?php echo ini_get("allow_url_fopen") ? '支持' : '不支持'; ?></em> </span> </a> <a class="list-group-item"> <i class="fa fa-code-fork fa-fw"></i> PHP版本 <span class="pull-right text-muted small"> <em><?php echo "php ".PHP_VERSION;?></em> </span> </a> <a class="list-group-item"> <i class="fa fa-database fa-fw"></i> MySQL版本 <span class="pull-right text-muted small"> <em><?php echo "mysql ".mysql_get_server_info();?></em> </span> </a> <a class="list-group-item"> <i class="fa fa-leaf fa-fw"></i> 程序版本 <span class="pull-right text-muted small"> <em><?php echo $cfg_version; ?></em> </span> </a> </div>
      </div>
        </div>
  </div>
      <div class="col-md-4 col-xs-12">
    <div class="weather">
          <div class="panel-body">
        <div class="row">
              <div class="col-xs-12 city" id="weather-city"></div>
              <div class="col-xs-6 icons"> <span id="weather-icon"></span>
            <p id="weather-du"></p>
          </div>
              <div class="col-xs-6 icons"> <img src="images/icon/windy.png">
            <p id="weather-windy"></p>
          </div>
            </div>
      </div>
        </div>
    <div class="mainbox contact">
          <div class="maincontent">
        <div class="avatar"> <img src="images/logo.jpg"> </div>
        <div class="profile">
              <div class="list-group"> <a class="list-group-item"> <i class="fa fa-user fa-fw"></i> 联系人 <span class="pull-right text-muted small"> <em></em> </span> </a> <a class="list-group-item"> <i class="fa fa-mobile-phone fa-fw"></i> 电话 <span class="pull-right text-muted small"> <em></em> </span> </a> <a class="list-group-item"> <i class="fa fa-qq fa-fw"></i> QQ <span class="pull-right text-muted small"> <em></em> </span> </a> <a class="list-group-item"> <i class="fa fa-envelope-o fa-fw"></i> E-mail <span class="pull-right text-muted small"> <em></em> </span> </a> <a class="list-group-item"> <i class="fa fa-map-marker fa-fw"></i> 地址 <span class="pull-right text-muted small"> <em></em> </span> </a> </div>
            </div>
      </div>
        </div>
  </div>
    </div>

<!--[if lt IE 9]>
	<script src="http://cdn.bootcss.com/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
	<![endif]--> 
<script src="http://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script> 
<script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
<script type="text/javascript">
		//统计数量
	    function setSN(e){
	        var ul = document.getElementById(e);
	        var lis= ul.getElementsByTagName('dd');
	        for(var i=0,l=lis.length;i<l;i++){
	            var tHTML = lis[i].innerHTML
	            lis[i].innerHTML = '<span>'+(i+1)+'</span>'+tHTML;
	        }
	    }
	    setSN('totalList');
	</script> 
<script type="text/javascript">
		//天气
		function findWeather() {
		  var cityUrl = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js';
		  $.getScript(cityUrl, function(script, textStatus, jqXHR) {
		    var citytq = remote_ip_info.city ;// 获取城市
		    var city = citytq;
		    var url = "http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&city=" + citytq + "&day=0&dfc=3";
		    $.ajax({
		      url : url,
		      dataType : "script",
		      scriptCharset : "gbk",
		      success : function(data) {
		        var _w = window.SWther.w[citytq][0];
		        var _f= _w.f1 +".png";
		        if(new Date().getHours() > 17){
		           _f= _w.f2 +".png";        
		        }
		        var img = "<img width='70px' height='70px' src='images/icon/" +_f
		        + "' />";
		        var weathercity = ""+ citytq +"";
		        $('#weather-city').html(weathercity);
		        var weathericon = "" + img + "";
		        $('#weather-icon').html(weathericon);
		        var weatherdu = "" + _w.t1 + "℃～" + _w.t2 + "℃";
		        $('#weather-du').html(weatherdu);
		        var weatherwindy = "" + _w.d1 + _w.p1 + "级";
		        $('#weather-windy').html(weatherwindy);
		      }
		    });
		  });
		}
		findWeather();
	</script>
</body>
</html>